<?php if ( ! defined('BASEPATH')) exit ('No direct script access allowed');

class email extends CI_Controller{
	
	function __constructor(){
		parent::Controller();
	}
	
	function index(){
		
		$config = array(
				'protocol' => 'SMTP',
				'smtp_host' => 'ssl://smtp.gmail.com',
				'smtp_port' =>'465',
				'smtp_user' => 'colinyan@gmail.com',
				'smtp_pass' => 'C0l1ny12'
    	);
		$this->load->library('email', $config);
		$this->email->set_newline('\r\n');  //�������п��ܻ���ִ���
		
		$this->email->from('colinyan@gmail.com', 'chao yan');
		$this->email->to('colinyan@gmail.com');
		$this->email->subject('test subject of php email sending');
		$this->email->message('This is the content of subject email.');
		
		if ($this->email->send()){
			echo 'Email has been sent successfully.';
		}
		else {
			show_error($this->email->print_debugger()); 
			
		}
	}
	
}